
import {
    instance
} from "@/utils";

/**
 * 创建wifi码
 * 要打开的小程序版本。正式版为 "release"，体验版为 "trial"，开发版为 "develop"。默认是正式版。
 * @param {*} data
 * @returns
 */
export async function addWifiCodeApi(data) {
    return instance.request({
        url: "/wifiCode/addWifiCode",
        method: "post",
        custom: {
            auth: true,
        },
        data: {
            ...data,
            codeStatus: 'release'
        },
    });
}
/**
 * 创建wifi码主页提示信息
 * @param {*} data
 * @returns
 */
export async function getPromptListApi(data) {
    return instance.request({
        url: "/wifiCode/getPromptList",
        method: "post",
        custom: {
            auth: true,
        },
        data,
    });
}

/**
 * 添加Wifi链接记录
 * @param {*} data
 * @returns
 */
export async function addConnectionRecordApi(data) {
    return instance.request({
        url: "/connectionRecord/addConnectionRecord",
        method: "post",
        data,
    });
}


/**
 * 查询我创建的Wifi列表
 * @param {*} data
 * @returns
 */
export async function getWifiCodeInfoListApi(data) {
    return instance.request({
        url: "/wifiCode/getWifiCodeInfoList",
        method: "post",
        custom: {
            auth: true,
        },
        data,
    });
}

/**
 * 接收 wifi连接码
 * @param {*} data
 * @returns
 */
export async function updWifiCodeApi(data) {
    return instance.request({
        url: "/wifiCode/updWifiCode",
        method: "post",
        custom: {
            auth: true,
        },
        data,
    });
}


/**
 * 通过id查询wifi码信息
 * @param {*} data
 * @returns
 */
export async function getWifiCodeInfoApi(data) {
    return instance.request({
        url: "/wifiCode/getWifiCodeInfo",
        method: "post",
        data,
    });
}


/**
 * 删除WIFI
 * @param {*} data
 * @returns
 */
export async function delWifiCodeInfoApi(data) {
    return instance.request({
        url: "/wifiCode/delWifiCodeInfo",
        method: "post",
        custom: {
            auth: true,
        },
        data,
    });
}

